<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */

//取出此期賽程
$arrGamble = getNewGambleData($intLottoID, 0);
if($arrGamble === false){
	ErrMsgOutputHTML("Error", "", 1);
}
if(sizeof($arrGamble) == 0){
	$arrGamble = getNewGambleData($intLottoID, 1);
	if($arrGamble === false){
		ErrMsgOutputHTML("Error", "", 1);
	}
}
$intGID = $arrGamble["ID"];

if(!empty($intGID))$_strGDate = DateForm($arrGamble["GameDate"], $arrGamble["GameTime"], "Y-m-d", "UToC")."&nbsp;".TimeForm($arrGamble["GameDate"], $arrGamble["GameTime"], "h:i a", "UToC");

$arrTmp = split("-", $arrLotto["Number"]);
for($i = intval($arrTmp[0]); $i <= intval($arrTmp[1]); $i++)$_strNumber .= $i.",";
$_strNumber = substr($_strNumber, 0, strlen($_strNumber) - 1);

$strSQL = "select ID, Account from `bet_Member` where MemberGroup = 21 and isLock = 0";
$strSQL .= ($_data["isGetSuppleOdds"] == "Y")?" and Account = '".$_KSysParam["SuppleReAccount"]."'":" and Account != '".$_KSysParam["SuppleReAccount"]."'";
if(!$RS = @PMA_mysql_query($strSQL, $$_Conn)){
	$GLOBALS["errorhidden"] = "Find User Data Error!";
	$GLOBALS["errorhidden"] = "SQL: ".$strSQL.", \nError: ".PMA_mysql_error($$_Conn).", \nLine: ".__LINE__.", \nPage: ".__FILE__;
	ErrMsgOutputHTML("Error", "", 1);
}
while($Rows = PMA_mysql_fetch_object($RS)){
	$strOption .= "<option value=\"".$Rows -> ID."\">".$Rows -> Account."</option>";
}

//$arrMaxOdds = array();
//$arrJumpOdds = array();
$arrBTTip = array();
for($i = 1; $i <= sizeof($_arrBetParam); $i++){
	$intTmpBT = $i;
	$arrBTTip[] = "arrBetType[".$intTmpBT."] = \"".$_arrBet_Type[$arrLotto["LType"]][$intTmpBT]."\"";
	//foreach($_arrBetParam[$i] as $intAN => $arrParam){
	//	$arrMaxOdds[] = "MaxOdds[".$i."][".$intAN."] = ".$arrParam["maxOdds"];
	//	$arrJumpOdds[] = "arrJumpOdds[".$i."][".$intAN."] = ".$arrParam["StakeJumpRate"];
	//}
}
?><!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> <?php print $_strSupplement7S["Title"];?> (Add) </title>
<link rel="stylesheet" href="../../css/backend.css?time=01" type="text/css">
<link href="../../css/loto_lb.css?time=01" rel="stylesheet" type="text/css">
<script language="JavaScript1.2" type="text/javascript" src="/inc/SupplementTemp7Star<?php print $_intLang?>.js?time=01"></script>
<script language="JavaScript1.2" type="text/javascript" src="/inc/admin_envirset.js"></script>
<script language="JavaScript1.2" type="text/javascript" src="/inc/cookie.js"></script>
<script language="JavaScript">
<!--
var Game1 = new Array(), Game2 = new Array(), Game3 = new Array(), Game4 = new Array(), Game5 = new Array(), Game6 = new Array();
var Game7 = new Array(), Game8 = new Array(), Game9 = new Array(), Game10 = new Array();
var Game11 = new Array();
var Game12 = new Array(), Game13 = new Array();
var Game14 = new Array(), Game15 = new Array(), Game16 = new Array(), Game17 = new Array();
var Game18 = new Array(), Game19 = new Array(), Game20 = new Array(), Game21 = new Array(), Game22 = new Array();
//var strGameTime = "<?php print $_strGDate;?>";
//var strGameNo = "<?php print $arrGamble["SerialNo"];?>";
var intSortPlus = -1;
var strLottoNum = "<?php print $_strNumber;?>";
var arrSpecialNum = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var arrSpecialCon = new Array("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
var strLottoID = "<?php print $intLottoID;?>";
var strBetType = "14,15,18,19,20,21,22";
var intChangeBT = 0;
var RSeconds = 0;
var AutoRefreshID = 0;
//正常下注用
var sumStake = new Array(), sumPayOff = new Array(), sumCommission = new Array(), sumWStake = new Array();
sumStake[14] = new Array(), sumPayOff[14] = new Array(), sumCommission[14] = new Array(), sumWStake[14] = new Array();
sumStake[15] = new Array(), sumPayOff[15] = new Array(), sumCommission[15] = new Array(), sumWStake[15] = new Array();
sumStake[16] = new Array(), sumPayOff[16] = new Array(), sumCommission[16] = new Array(), sumWStake[16] = new Array();
sumStake[17] = new Array(), sumPayOff[17] = new Array(), sumCommission[17] = new Array(), sumWStake[17] = new Array();

//補貨用
var sumSuppleStake = new Array(), sumSupplePayOff = new Array(), sumSuppleCommission = new Array();
sumSuppleStake[14] = new Array(), sumSupplePayOff[14] = new Array(), sumSuppleCommission[14] = new Array();
sumSuppleStake[15] = new Array(), sumSupplePayOff[15] = new Array(), sumSuppleCommission[15] = new Array();
sumSuppleStake[16] = new Array(), sumSupplePayOff[16] = new Array(), sumSuppleCommission[16] = new Array();
sumSuppleStake[17] = new Array(), sumSupplePayOff[17] = new Array(), sumSuppleCommission[17] = new Array();

var strBalanceText = "<?php print $_strSupplement7S["BalanceText"];?> ";
var strT1 = "<?php print $_strSupplement7S["Bet1"];?>", strTAll7 = "<?php print $_strOperate7S["BetAll7"];?>", strT7 = "<?php print $_strSupplement7S["Bet7"];?>", strT8 = "<?php print $_strSupplement7S["Bet8"];?>", strT9 = "<?php print $_strSupplement7S["Bet9"];?>", strT10 = "<?php print $_strSupplement7S["Bet10"];?>", strT11 = "<?php print $_strSupplement7S["Bet11"];?>", strT12 = "<?php print $_strSupplement7S["Bet12"];?>", strT13 = "<?php print $_strSupplement7S["Bet13"];?>", strT16 = "<?php print $_strSupplement7S["Bet16"];?>", strT18 = "<?php print $_strSupplement7S["Bet18"];?>", strTSG = "<?php print $_strSupplement7S["StartGame"];?>";

//var MaxOdds = new Array();
//var arrJumpOdds = new Array();
var arrBetType = new Array();
<?php 
//	print join("; ", $arrMaxOdds).";";
//	print join("; ", $arrJumpOdds).";";
	print join("; ", $arrBTTip).";";
?>
var arrJNSort = new Array();
var intSortSite = 0;
var isGetSuppleOdds = "<?php print $_data["isGetSuppleOdds"];?>";
var arrWin = new Array(<?php print "'".$_strSame_String[Win]."', '".$_strSame_String[NoWin]."'";?>);
var arrTwin = new Array();
arrTwin[1] = "OOXX";
arrTwin[2] = "OXOX";
arrTwin[3] = "OXXO";
arrTwin[4] = "XOOX";
arrTwin[5] = "XOXO";
arrTwin[6] = "XXOO";

var arrTrinityTip = new Array();
arrTrinityTip[1] = "<?php print $_strSupplement7S["Milli"];?>";
arrTrinityTip[2] = "<?php print $_strSupplement7S["Cent"];?>";
arrTrinityTip[3] = "<?php print $_strSupplement7S["Dec"];?>";
arrTrinityTip[4] = "<?php print $_strSupplement7S["Unit"];?>";

//定位初始化
function iniNumber(intBT){
	var arrNumber = new Array();
	if(intBT == 18){
		document.getElementById("ListStatus").innerHTML = strT18;
		document.getElementById("BetList").innerHTML = strLayer18;

	}else if(intBT == 16){
		document.getElementById("ListStatus").innerHTML = strT16;
		document.getElementById("BetList").innerHTML = strLayer16;
	}
	GetOdds();
}

function NumFormat(intNum){
	return (intNum < 10)?("0" + intNum.toString()):intNum.toString();
}

function changEmergency(){
	document.getElementById("EmergencyLink").innerHTML = (isEmergency == 0)?"<?php print $_strSupplement7S["EmergencyOff"];//緊急關閉?>":"<?php print $_strSupplement7S["EmergencyOpen"];//系統開放?>";
	document.getElementById("EmergencyLink").className = (isEmergency == 0)?"G_Con_Emergency_Off":"G_Con_Emergency_On";
}

function takeEmergency(){
	with(document.getDataForm){
		op.value = "OffAllWager";
		intEmergency.value = (isEmergency == 0)?"1":"0";
		submit();
	}
}

function changSort(){
	intSortPlus *= -1;
	changSortClass();
	RefreshType();
}

function changSortClass(){
	document.getElementById("TenSortLink").innerHTML = (intSortPlus == -1)?"<?php print $_strSupplement7S["TenLoseSort"];//十大負值排行?>":"<?php print $_strSupplement7S["TenWinSort"];//十大正值排行?>";
	document.getElementById("TenSortTD").className = (intSortPlus == -1)?"G_Con_SortLoseTD":"G_Con_SortWinTD";
}

function ValueSort(arrValue, intValue, intNum, strCon){
	var i = 0, intTmp = 0, intTmp2 = 0, isMoveDown = false;
	for(i = 0; i < arrValue.length; i++){
		if(isMoveDown == false){
			if(arrValue[i] < intValue){
				intTmp = arrValue[i];
				intNum1 = arrSpecialNum[i];
				strCon1 = arrSpecialCon[i];
				arrValue[i] = intValue;
				arrSpecialNum[i] = intNum;
				arrSpecialCon[i] = strCon;
				isMoveDown = true;
			}
		}else{
			if(isMoveDown == true){
				intTmp2 = arrValue[i];
				intNum2 = arrSpecialNum[i];
				strCon2 = arrSpecialCon[i];
				arrValue[i] = intTmp;
				arrSpecialNum[i] = intNum1;
				arrSpecialCon[i] = strCon1;
				intTmp = intTmp2;
				intNum1 = intNum2;
				strCon1 = strCon2;
			}
		}
	}
	return arrValue;
}


//定位 一字
function ShowNumberOdds18(intBT){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), sumOdds = 0, maxPayOff = 0, intTmp = 0, intTmp2 = 0, intBT, preWin = 0, preWin2 = 0, strClass = "", strCon = "", intBalance = 0, flOdds = 0, isReData = "";// sumPayOff = 0,
	var arrBT = new Array(18, 19, 20, 21, 22);
	var arrBTMinNum = new Array(0, 0, 0, 0, 0);
	var arrBTMaxNum = new Array(9, 9, 9, 9, 9);
	var strTDSite = "";

	for(var i = 0; i < arrBT.length; i++){
		intBT = arrBT[i];
		arrTmpGame = eval("Game" + intBT.toString());

		for(var intNum = arrBTMinNum[i]; intNum <= arrBTMaxNum[i]; intNum++){
			flOdds = parseFloat(arrTmpGame[intNum][5]);
			intTmp = parseFloat(arrTmpGame[intNum][9]) + parseFloat(arrTmpGame[intNum][8]);
			intTmp2 = parseFloat(arrTmpGame[i][13]) + parseFloat(arrTmpGame[i][12]);
			preWin2 = intTmp2 - sumSuppleStake[intBT] + sumSuppleCommission[intBT] ; //派彩所得 - 總下注金額 + 所有退水
			preWin = sumStake[intBT] - intTmp - sumCommission[intBT] + preWin2;
			strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

			strTDSite = intBT.toString() + "_" + intNum.toString();
			document.getElementById("NumLink"+strTDSite).href = "JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+intNum+", "+arrTmpGame[intNum][5]+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intNum+");";


			strCon = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+intNum+", "+flOdds+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intNum+")\">"+flOdds+"</a>";
			
			document.getElementById("OddsTD"+strTDSite).innerHTML = strCon;

			strCon = "<a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+intNum+",0,"+intNum+")\">"+arrTmpGame[intNum][11]+"/"+Math.round(parseFloat(arrTmpGame[intNum][12])).toString()+"</a>";

			strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

			strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
			strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

			document.getElementById("Num"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
			document.getElementById("OddsTD"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";
			if(isGetSuppleOdds == "Y")document.getElementById("OddsTD"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
			document.getElementById("WagerTD"+strTDSite).innerHTML = strCon;
		}
		document.getElementById("SumWagerTD"+intBT.toString()).innerHTML = sumSuppleStake[intBT];
	}	//for(var i = 0; i < arrBT.length; i++)

	for(var intBT = 14; intBT <= 15; intBT++){
		arrTmpGame = eval("Game" + intBT.toString());
		intGapOdds = 1;
		for(var intNum1 = 0; intNum1 <= 3; intNum1++){
			for(var intNum2 = 0; intNum2 <= 1; intNum2++){
				intNum = intNum1*10 + intNum2;
				flOdds = arrTmpGame[intNum][5]*1 + intGapOdds;
				flOdds = Math.round(flOdds*1000) / 1000;
				//sumOdds += 1 / parseFloat(arrTmpGame[intNum][5]);
				intTmp = parseFloat(arrTmpGame[intNum][9]) + parseFloat(arrTmpGame[intNum][8]);
				intTmp2 = parseFloat(arrTmpGame[intNum][13]) + parseFloat(arrTmpGame[intNum][12]);
				preWin2 = intTmp2 - sumSuppleStake[intBT][intNum1] + sumSuppleCommission[intBT][intNum1]; //派彩所得 - 總下注金額 + 所有退水
				preWin = sumStake[intBT][intNum1] - intTmp - sumCommission[intBT][intNum1] + preWin2;
				strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

				strTDSite = intBT.toString() + "_" + intNum.toString();
				
				document.getElementById("NumLink"+strTDSite).href = "JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+intNum+", "+arrTmpGame[intNum][5]+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intNum+");";

				strCon = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+intNum+", "+flOdds+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intNum+")\">"+flOdds+"</a>";
				
				document.getElementById("OddsTD"+strTDSite).innerHTML = strCon;

				strCon = "<a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+intNum+",0,"+intNum+")\">"+arrTmpGame[intNum][11]+"/"+Math.round(parseFloat(arrTmpGame[intNum][12])).toString()+"</a>";

				strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

				strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
				strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

				document.getElementById("Num"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
				document.getElementById("OddsTD"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";
				if(isGetSuppleOdds == "Y")document.getElementById("OddsTD"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
				document.getElementById("WagerTD"+strTDSite).innerHTML = strCon;
			}
		}
	}
}

//合數單雙大小
function ShowNumberOdds16(intBT){
	var intNum = 0, strTD = "", strTip = "", arrTmpGame = new Array(), sumOdds = 0, maxPayOff = 0, intTmp = 0, intTmp2 = 0, OverBetOn, OverBet, OverBetColor, intBT, preWin = 0, preWin2 = 0, strClass = "", strCon = "", flOdds = 0, flComm, intGapOdds = 1;// sumPayOff = 0,
	var strTDSite = "";

	for(var intBT = 16; intBT <= 17; intBT++){
		arrTmpGame = eval("Game" + intBT.toString());
		intGapOdds = 1;
		for(var intNum1 = 0; intNum1 <= 5; intNum1++){
			for(var intNum2 = 0; intNum2 <= 1; intNum2++){
				intNum = intNum1*10 + intNum2;
				flOdds = arrTmpGame[intNum][5]*1 + intGapOdds;
				flOdds = Math.round(flOdds*1000) / 1000;
				//sumOdds += 1 / parseFloat(arrTmpGame[intNum][5]);
				intTmp = parseFloat(arrTmpGame[intNum][9]) + parseFloat(arrTmpGame[intNum][8]);
				intTmp2 = parseFloat(arrTmpGame[intNum][13]) + parseFloat(arrTmpGame[intNum][12]);
				preWin2 = intTmp2 - sumSuppleStake[intBT][intNum1] + sumSuppleCommission[intBT][intNum1]; //派彩所得 - 總下注金額 + 所有退水
				preWin = sumStake[intBT][intNum1] - intTmp - sumCommission[intBT][intNum1] + preWin2;
				strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

				strTDSite = intBT.toString() + "_" + intNum.toString();

				document.getElementById("NumLink"+strTDSite).href = "JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+intNum+", "+arrTmpGame[intNum][5]+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intNum+");";

				strCon = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+intNum+", "+flOdds+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intNum+")\">"+flOdds+"</a>";

				document.getElementById("OddsTD"+strTDSite).innerHTML =  strCon;

				strCon = "<a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+intNum+",0,"+intNum+")\">"+arrTmpGame[intNum][11]+"/"+Math.round(parseFloat(arrTmpGame[intNum][12])).toString()+"</a>";

				strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

				strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
				strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

				document.getElementById("Num"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
				document.getElementById("OddsTD"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";
				if(isGetSuppleOdds == "Y")document.getElementById("OddsTD"+strTDSite).className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";

				document.getElementById("WagerTD"+strTDSite).innerHTML = strCon;
			}
		}
	}
}

//取得三定位 號碼組合
function getTrinityNumber(){
	for(var i = 0; i < document.OddsListForm["STrinity"].length; i++)if(document.OddsListForm["STrinity"][i].checked)var strTrinity = document.OddsListForm["STrinity"][i].value;
	for(var i = 0; i < document.OddsListForm["STrinityNo"].length; i++)if(document.OddsListForm["STrinityNo"][i].checked)var strSTriNo = document.OddsListForm["STrinityNo"][i].value;

	var arrTriNum = new Array();
	for(var i = 0; i <= 9; i++){
		for(var j = 0; j <= 9; j++){
			switch(strTrinity){
				case "Cent":
					arrTriNum[i*10 + j] = strSTriNo*100 + i*10 + j*1;
					break;
				case "Dec":
					arrTriNum[i*10 + j] = i*100 + strSTriNo*10 + j*1;
					break;
				case "Unit":
					arrTriNum[i*10 + j] = i*100 + j*10 + strSTriNo*1;
					break;
			}
		}
	}
	document.getDataForm.strLottoNumber.value = arrTriNum.join(",");
}

//取得四定位 號碼組合
function getFourNumber(){
	for(var i = 0; i < document.OddsListForm["STwin"].length; i++){
		document.getElementById("TwinTip"+i).className =  "";
		if(document.OddsListForm["STwin"][i].checked)var strSTwin = document.OddsListForm["STwin"][i].value;
	}
	for(var i = 0; i < document.OddsListForm["STrinityNo0"].length; i++){
		document.getElementById("STrinityNoTip0"+i).className =  "";
		if(document.OddsListForm["STrinityNo0"][i].checked)var strSTriNo0 = document.OddsListForm["STrinityNo0"][i].value;
	}
	for(var i = 0; i < document.OddsListForm["STrinityNo1"].length; i++){
		document.getElementById("STrinityNoTip1"+i).className =  "";
		if(document.OddsListForm["STrinityNo1"][i].checked)var strSTriNo1 = document.OddsListForm["STrinityNo1"][i].value;
	}

	var a1 = 0, a2 = 0, a3 = 0, a4 = 0;
	switch(strSTwin){
		case "0": //OOXX
			var a1 = 1000, a2 = 100, a3 = 10, a4 = 1;
			document.getElementById("STrinity0").innerHTML = arrTrinityTip[1];
			document.getElementById("STrinity1").innerHTML = arrTrinityTip[2];
			break;
		case "1": //OXOX
			var a1 = 1000, a2 = 10, a3 = 100, a4 = 1;
			document.getElementById("STrinity0").innerHTML = arrTrinityTip[1];
			document.getElementById("STrinity1").innerHTML = arrTrinityTip[3];
			break;
		case "2": //OXXO
			var a1 = 1000, a2 = 1, a3 = 100, a4 = 10;
			document.getElementById("STrinity0").innerHTML = arrTrinityTip[1];
			document.getElementById("STrinity1").innerHTML = arrTrinityTip[4];
			break;
		case "3": //XOOX
			var a1 = 100, a2 = 10, a3 = 1000, a4 = 1;
			document.getElementById("STrinity0").innerHTML = arrTrinityTip[2];
			document.getElementById("STrinity1").innerHTML = arrTrinityTip[3];
			break;
		case "4": //XOXO
			var a1 = 100, a2 = 1, a3 = 1000, a4 = 10;
			document.getElementById("STrinity0").innerHTML = arrTrinityTip[2];
			document.getElementById("STrinity1").innerHTML = arrTrinityTip[4];
			break;
		case "5": //XXOO
			var a1 = 10, a2 = 1, a3 = 1000, a4 = 100;
			document.getElementById("STrinity0").innerHTML = arrTrinityTip[3];
			document.getElementById("STrinity1").innerHTML = arrTrinityTip[4];
			break;
	}
	document.getElementById("TwinTip"+strSTwin).className =  "G_Con_St_Trinity";
	document.getElementById("STrinityNoTip0"+strSTriNo0).className =  "G_Con_St_Trinity";
	document.getElementById("STrinityNoTip1"+strSTriNo1).className =  "G_Con_St_Trinity";

	var arrTriNum = new Array();
	for(var i = 0; i <= 9; i++){
		for(var j = 0; j <= 9; j++){
			arrTriNum[i*10 + j] = strSTriNo0*a1 + strSTriNo1*a2 + i*a3 + j*a4;
		}
	}
	document.getDataForm.strLottoNumber.value = arrTriNum.join(",");
}

//四定位 初始化
function iniFourNumber(intBT){
	var strNum = "", strOtherMsg = "";
	if(null == document.getElementById("FourTypeTD"))document.getElementById("BetList").innerHTML = strLayer11;

	if(document.OddsListForm["STrinity"][0].checked){
		document.getDataForm.OtherMsg.value = "Sort";
		document.getElementById("FourTypeTD").style.display = "none";
		document.getElementById("STrinity0").innerHTML = "&nbsp;";
		document.getElementById("STrinity1").innerHTML = "&nbsp;";
	}else{
		document.getDataForm.OtherMsg.value = "";
		document.getElementById("FourTypeTD").style.display = "block";
		getFourNumber();
	}
	GetOdds();
}

//三字 初始化
function ini3WordNumber(intBT){
	var strNum = "", strOtherMsg = "";
	if(null == document.getElementById("TreeWordTD"))document.getElementById("BetList").innerHTML = strLayer13;

	if(document.OddsListForm["STrinity"][0].checked){
		document.getDataForm.OtherMsg.value = "Sort";
	}else{
		document.getDataForm.OtherMsg.value = "";
	}
	var arrTriNum = new Array(), j = 0;
	for(var i = 0; i <= 999; i++){
		if(i < 100){
			if(Math.floor(i / 10) > (i % 10))continue;
		}else{
			if(Math.floor(i / 10) > (i % 100))continue;
			if(Math.floor((i % 100) / 10) > (i % 10))continue;
		}
		arrTriNum[j] = i;
		j++;
	}
	document.getDataForm.strLottoNumber.value = arrTriNum.join(",");
	GetOdds();
}

//三字 賠率表
function Show3WordNumber(intBT){
	var intNum, arrTmpGame = new Array(), objOTD, objNTD, sumOdds = 0, minPayOff = 0, intTmp = 0, preWin = 0, preWin2 = 0, strClass = "", strNum = "", intSNum, intBalance = 0, flOdds = 0, isReData = "", intStake = 0;
	var arrColor = ["#000000", "#FF0000", "#330099", "#336600", "#660099", "#FF6600", "#660000", "#004080", "#800080", "#808000"];
	var strColor = "";

	intBalance = parseInt(document.getElementById("BalanceValue").value);
	isReData = document.MultiOddsLayer.isRefreshData.value;
	document.MultiOddsLayer.isRefreshData.value = "0";
	arrTmpGame = eval("Game" + intBT.toString());
	for(intNum = 0; intNum <= 219; intNum++){
		intSNum = intNum;
		strNum = arrTmpGame[intNum][3];

		flOdds = parseFloat(arrTmpGame[intNum][5]);
		sumOdds += 1 / parseFloat(arrTmpGame[intNum][5]);
		intTmp = parseFloat(arrTmpGame[intNum][9]) + parseFloat(arrTmpGame[intNum][8]);
		intTmp2 = parseFloat(arrTmpGame[intNum][13]) + parseFloat(arrTmpGame[intNum][12]);
		preWin2 = intTmp2 - sumSuppleStake[intBT] + sumSuppleCommission[intBT]; //派彩所得 - 總下注金額 + 所有退水
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT] + preWin2;
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

		objNTD = document.getElementById("Num13_"+intSNum.toString());
		objOTD = document.getElementById("OddsTD13_"+intSNum.toString());

		strCon = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Odds\">"+arrTmpGame[intNum][5]+"</a><br />";
		strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+strNum+",0,"+intSNum+")\">"+Math.round(parseFloat(arrTmpGame[intNum][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";//+arrTmpGame[intNum][7]+"/"

		//顯示號碼
		strColor = arrColor[Math.floor(strNum*1 / 100)];
		if(strNum.length == 1)strNum = "00"+strNum;
		if(strNum.length == 2)strNum = "0"+strNum;
		strCon = "JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+arrTmpGame[intNum][3]+", "+arrTmpGame[intNum][5]+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intSNum+");";
		objNTD.innerHTML = "<a class='G_Con_Numer_blue' id='NumLink13_"+intSNum.toString()+"' style='color: "+strColor+"' href='"+strCon+"'>" + strNum + "</a>";

		//顯示賠率
		strCon = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+arrTmpGame[intNum][3]+", "+flOdds+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intSNum+")\">"+flOdds+"</a>";
		//顯示補貨
		strCon += "<br /><a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+arrTmpGame[intNum][3]+",0,"+intSNum+")\">"+arrTmpGame[intNum][11]+"/"+Math.round(parseFloat(arrTmpGame[intNum][12])).toString()+"</a>";
		//顯示輸贏金額
		strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		objNTD.className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		objOTD.className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";

		if(isGetSuppleOdds == "Y")objOTD.className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
		//建議補貨額度
		if(preWin < intBalance){	//補貨計算
			strCon += "<br /><a class=\"G_Con_Balance\">"+strBalanceText+Math.floor((intBalance - preWin)/flOdds).toString()+"</a>";
		}
		objOTD.innerHTML = strCon;
		if(minPayOff > intTmp2)minPayOff = intTmp2;
	}
	document.getElementById("TwinSumStake").innerHTML = sumSuppleStake[intBT];
	document.getElementById("MaxLose").innerHTML = Math.round(minPayOff + sumSuppleCommission[intBT] - sumSuppleStake[intBT]);
}


//三定位 初始化
function iniTrinityNumber(intBT){
	var strNum = "", strOtherMsg = "";
	if(null == document.getElementById("TrinityTypeTD")){
		document.getElementById("BetList").innerHTML = strLayer7;
	}

	if(document.OddsListForm["STrinity"][0].checked){
		document.getDataForm.OtherMsg.value = "Sort";
	}else{
		document.getDataForm.OtherMsg.value = "";
		getTrinityNumber();
	}

	document.getElementById("TwinTip7").className =  "";
	document.getElementById("TwinTip8").className =  "";
	document.getElementById("TwinTip9").className =  "";
	document.getElementById("TwinTip10").className =  "";
	document.getElementById("TwinTip"+intBT).className =  "G_Con_St_Trinity";
	switch(intBT){
		case 7:
			document.getElementById("STrinityTip1").innerHTML = arrTrinityTip[1];
			document.getElementById("STrinityTip2").innerHTML = arrTrinityTip[2];
			document.getElementById("STrinityTip3").innerHTML = arrTrinityTip[3];
			break;

		case 8:
			document.getElementById("STrinityTip1").innerHTML = arrTrinityTip[1];
			document.getElementById("STrinityTip2").innerHTML = arrTrinityTip[2];
			document.getElementById("STrinityTip3").innerHTML = arrTrinityTip[4];
			break;

		case 9:
			document.getElementById("STrinityTip1").innerHTML = arrTrinityTip[1];
			document.getElementById("STrinityTip2").innerHTML = arrTrinityTip[3];
			document.getElementById("STrinityTip3").innerHTML = arrTrinityTip[4];
			break;

		case 10:
			document.getElementById("STrinityTip1").innerHTML = arrTrinityTip[2];
			document.getElementById("STrinityTip2").innerHTML = arrTrinityTip[3];
			document.getElementById("STrinityTip3").innerHTML = arrTrinityTip[4];
			break;
	}
	GetOdds();
}

function ChangeUnit(){
	ChangeBet(strBetType);
}

function ChangeBetNo(){
	ChangeBet(strBetType);
}

//四定位 賠率表
function ShowFourNumber(intBT){
	var intNum, arrTmpGame = new Array(), objOTD, objNTD, sumOdds = 0, minPayOff = 0, intTmp = 0, preWin = 0, preWin2 = 0, strClass = "", strNum = "", intSNum, intBalance = 0, flOdds = 0, isReData = "", intStake = 0;

	intBalance = parseInt(document.getElementById("BalanceValue").value);
	isReData = document.MultiOddsLayer.isRefreshData.value;
	document.MultiOddsLayer.isRefreshData.value = "0";

	arrTmpGame = eval("Game" + intBT.toString());
	for(intNum = 0; intNum <= 99; intNum++){
		intSNum = intNum;
		if(document.OddsListForm["STrinity"][0].checked){
			intSNum = (intNum % 10)*10 + Math.floor(intNum / 10);
		}
		strNum = arrTmpGame[intNum][3];

		flOdds = parseFloat(arrTmpGame[intNum][5]);
		sumOdds += 1 / parseFloat(arrTmpGame[intNum][5]);
		intTmp = parseFloat(arrTmpGame[intNum][9]) + parseFloat(arrTmpGame[intNum][8]);
		intTmp2 = parseFloat(arrTmpGame[intNum][13]) + parseFloat(arrTmpGame[intNum][12]);
		preWin2 = intTmp2 - sumSuppleStake[intBT] + sumSuppleCommission[intBT]; //派彩所得 - 總下注金額 + 所有退水
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT] + preWin2;
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

		objNTD = document.getElementById("Num11_"+intSNum.toString());
		objOTD = document.getElementById("OddsTD11_"+intSNum.toString());

		strCon = "<a href=\"JavaScript:void(0)\" class=\"G_Con_Odds\">"+arrTmpGame[intNum][5]+"</a><br />";
		strCon += "<a class=\"G_Con_Bet\" href=\"JavaScript: getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+strNum+",0,"+intSNum+")\">"+Math.round(parseFloat(arrTmpGame[intNum][8])).toString()+"</a><br /><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";//+arrTmpGame[intNum][7]+"/"

		//顯示號碼
		if(strNum.length == 1)strNum = "000"+strNum;
		if(strNum.length == 2)strNum = "00"+strNum;
		if(strNum.length == 3)strNum = "0"+strNum;
		strCon = "JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+arrTmpGame[intNum][3]+", "+arrTmpGame[intNum][5]+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intSNum+");";
		objNTD.innerHTML = "<a href='"+strCon+"' class='G_Con_Numer_blue' id='NumLink92_"+intSNum.toString()+"'>" + strNum + "</a>";

		//顯示賠率
		strCon = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+arrTmpGame[intNum][3]+", "+flOdds+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intSNum+")\">"+flOdds+"</a>";
		//顯示補貨
		strCon += "<br /><a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+arrTmpGame[intNum][3]+",0,"+intSNum+")\">"+arrTmpGame[intNum][11]+"/"+Math.round(parseFloat(arrTmpGame[intNum][12])).toString()+"</a>";
		//顯示輸贏金額
		strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		objNTD.className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Ball";
		objOTD.className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";

		if(isGetSuppleOdds == "Y")objOTD.className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
		//建議補貨額度
		if(preWin < intBalance){	//補貨計算
			strCon += "<br /><a class=\"G_Con_Balance\">"+strBalanceText+Math.floor((intBalance - preWin)/flOdds).toString()+"</a>";
		}
		objOTD.innerHTML = strCon;
		if(minPayOff > intTmp2)minPayOff = intTmp2;
	}
	document.getElementById("TwinSumStake").innerHTML = sumSuppleStake[intBT];
	document.getElementById("MaxLose").innerHTML = Math.round(minPayOff + sumSuppleCommission[intBT] - sumSuppleStake[intBT]);
}

//三定位 賠率表
function ShowTrinityNumber(intBT){
	var intNum, arrTmpGame = new Array(), objOTD, objNTD, sumOdds = 0, minPayOff = 0, intTmp = 0, preWin = 0, preWin2 = 0, strClass = "", strNum = "", intSNum, intBalance = 0, flOdds = 0, isReData = "", intStake = 0, strLNum = "", strMNum = "", strRNum = "", strShowNum = "";

	intBalance = parseInt(document.getElementById("BalanceValue").value);
	isReData = document.MultiOddsLayer.isRefreshData.value;
	document.MultiOddsLayer.isRefreshData.value = "0";
	arrTmpGame = eval("Game" + intBT.toString());
	for(intNum = 0; intNum <= 99; intNum++){
		intSNum = intNum;
		if(document.OddsListForm["STrinity"][0].checked){
			intSNum = (intNum % 10)*10 + Math.floor(intNum / 10);
		}
		strNum = arrTmpGame[intNum][3];

		flOdds = parseFloat(arrTmpGame[intNum][5]);
		sumOdds += 1 / parseFloat(arrTmpGame[intNum][5]);
		intTmp = parseFloat(arrTmpGame[intNum][9]) + parseFloat(arrTmpGame[intNum][8]);
		intTmp2 = parseFloat(arrTmpGame[intNum][13]) + parseFloat(arrTmpGame[intNum][12]);
		preWin2 = intTmp2 - sumSuppleStake[intBT] + sumSuppleCommission[intBT]; //派彩所得 - 總下注金額 + 所有退水
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT] + preWin2;
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

		objNTD = document.getElementById("Num7_"+intSNum.toString());
		objOTD = document.getElementById("OddsTD7_"+intSNum.toString());
		
		//顯示號碼
		if(strNum.length == 1)strNum = "00"+strNum;
		if(strNum.length == 2)strNum = "0"+strNum;
		strLNum = strNum.substr(0,1);
		strMNum = strNum.substr(1,1);
		strRNum = strNum.substr(2,1);
		switch(intBT){
			case 7:
				strShowNum = strLNum + strMNum + strRNum + "x";
				break;

			case 8:
				strShowNum = strLNum + strMNum + "x" + strRNum;
				break;

			case 9:
				strShowNum = strLNum + "x" + strMNum + strRNum;
				break;

			case 10:
				strShowNum = "x" + strLNum + strMNum + strRNum;
				break;
		}
		strCon = "JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+arrTmpGame[intNum][3]+", "+arrTmpGame[intNum][5]+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intSNum+");";
		objNTD.innerHTML = "<a href='"+strCon+"' class='G_Con_Numer_blue' id='NumLink7_"+intSNum.toString()+"'>" + strShowNum + "</a>";

		//顯示賠率
		strCon = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+arrTmpGame[intNum][3]+", "+flOdds+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intSNum+")\">"+flOdds+"</a>";
		//顯示補貨
		strCon += "<br /><a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+arrTmpGame[intNum][3]+",0,"+intSNum+")\">"+arrTmpGame[intNum][11]+"/"+Math.round(parseFloat(arrTmpGame[intNum][12])).toString()+"</a>";
		//顯示輸贏金額
		strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		objNTD.className = "G_Con_TD_Ball";
		objOTD.className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";

		if(isGetSuppleOdds == "Y")objOTD.className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
		//建議補貨額度
		if(preWin < intBalance){	//補貨計算
			strCon += "<br /><a class=\"G_Con_Balance\">"+strBalanceText+Math.floor((intBalance - preWin)/flOdds).toString()+"</a>";
		}
		objOTD.innerHTML = strCon;
		if(minPayOff > intTmp2)minPayOff = intTmp2;
	}
	document.getElementById("TwinSumStake").innerHTML = sumSuppleStake[intBT];
	document.getElementById("MaxLose").innerHTML = Math.round(minPayOff + sumSuppleCommission[intBT] - sumSuppleStake[intBT]);
}


//三定位總排名 初始化
function iniTrinityNumberSort(){
	var strNum = "", objOddsTB, intBT, intNo;
	document.getDataForm.OtherMsg.value = "AllSort";
	if(null != document.getElementById("TrinityTypeSortTD"))return GetOdds();

	document.getElementById("ListStatus").innerHTML = strTAll7;
	document.getElementById("BetList").innerHTML = strLayer7Sort;
	document.getElementById("TwinBT713").checked = true;

	document.getElementById("TwinTip713").className =  "G_Con_St_Trinity";
	document.getElementById("TwinTip7").className =  "";
	document.getElementById("TwinTip8").className =  "";
	document.getElementById("TwinTip9").className =  "";
	document.getElementById("TwinTip10").className =  "";

	objOddsTB = document.getElementById("OddsTable");

	with(objOddsTB)	{
		for(intNo = 0; intNo < 30; intNo++){
			newTR = insertRow();
			newTR.className = "G_Con_TR";
			newTR.align = "center";
			
			with(newTR){
				newTD = insertCell();
				newTD.innerHTML = intNo;

				for(intBT = 7; intBT <= 13; intBT++){
					if(intBT == 11)continue;

					if(intNo == 0){
						newTD = insertCell();
						newTD.rowSpan = 30;
						newTD.innerHTML = "&nbsp;";
					}

					newTD = insertCell();
					newTD.id = 'Num'+intBT+'_'+intNo;
					newTD.innerHTML = "00";

					newTD = insertCell();
					newTD.id = 'OddsTD'+intBT+'_'+intNo;
					newTD.innerHTML = "&nbsp;";
				}
			}
		}
	}
	GetOdds();
}

//顯示 三定位總排名 賠率表
function ShowTrinityNumberSort(){
	var intNum, strNum, arrTmpGame = new Array(), objOTD, objNTD, intTmp = 0, preWin = 0, preWin2 = 0, strClass = "", intBT, intNo, intTwinSumStake = 0, strLNum = "", strMNum = "", strRNum = "", strShowNum = "";

	intBalance = parseInt(document.getElementById("BalanceValue").value);
	isReData = document.MultiOddsLayer.isRefreshData.value;
	document.MultiOddsLayer.isRefreshData.value = "0";
	for(intBT = 7; intBT <= 13; intBT++){
		if(intBT == 11)continue;

		arrTmpGame = eval("Game" + intBT.toString());
		for(intNo = 0; intNo < 30; intNo++){
			var arrTGame = arrTmpGame[intNo];
			intNum = arrTGame[3];
			strNum = intNum.toString();

			flOdds = parseFloat(arrTGame[5]);
			intTmp = parseFloat(arrTGame[9]) + parseFloat(arrTGame[8]);
			intTmp2 = parseFloat(arrTGame[13]) + parseFloat(arrTGame[12]);
			preWin2 = intTmp2 - sumSuppleStake[intBT] + sumSuppleCommission[intBT]; //派彩所得 - 總下注金額 + 所有退水
			preWin = sumStake[intBT] - intTmp - sumCommission[intBT] + preWin2;
			strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

			objNTD = document.getElementById("Num"+intBT.toString()+"_"+intNo.toString());
			objOTD = document.getElementById("OddsTD"+intBT.toString()+"_"+intNo.toString());

			//顯示號碼
			if(strNum.length == 1)strNum = "00"+strNum;
			if(strNum.length == 2)strNum = "0"+strNum;
			strLNum = strNum.substr(0,1);
			strMNum = strNum.substr(1,1);
			strRNum = strNum.substr(2,1);
			switch(intBT){
				case 7:
					strShowNum = strLNum + strMNum + strRNum + "x";
					break;

				case 8:
					strShowNum = strLNum + strMNum + "x" + strRNum;
					break;

				case 9:
					strShowNum = strLNum + "x" + strMNum + strRNum;
					break;

				case 10:
					strShowNum = "x" + strLNum + strMNum + strRNum;
					break;

				case 12:
					strShowNum = strMNum + strRNum;
					break;

				case 13:
					strShowNum = strNum;
					break;
			}
			if(null == objNTD)alert(intBT.toString()+"_"+intNo.toString());
			strCon = "JavaScript:intSortSite=0;ShowOddsLayer("+arrTGame[1]+", "+intBT+", "+intNum+", "+flOdds+", "+arrTGame[4]+","+Math.floor(parseFloat(arrTGame[8]) - parseFloat(arrTGame[12]))+",0,"+intNo+");";
			objNTD.innerHTML = "<a href='"+strCon+"' class='G_Con_Numer_blue' id='NumSB"+intBT.toString()+"_"+intNo.toString()+"'>" + strShowNum + "</a>";

			//顯示賠率
			strCon = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:intSortSite=0;ShowOddsLayer("+arrTGame[1]+", "+intBT+", "+intNum+", "+flOdds+", "+arrTGame[4]+","+Math.floor(parseFloat(arrTGame[8]) - parseFloat(arrTGame[12]))+",0,"+intNo+")\">"+flOdds+"</a>";
			//顯示補貨
			strCon += "<br /><a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTGame[1]+","+arrTGame[2]+","+arrTGame[3]+",0,"+intNo+")\">"+arrTGame[11]+"/"+Math.round(parseFloat(arrTGame[12])).toString()+"</a>";
			//顯示輸贏金額
			strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

			strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
			strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

			objNTD.className = "G_Con_TD_Ball";
			objOTD.className = (arrTmpGame[intNo][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";

			if(isGetSuppleOdds == "Y")objOTD.className = (arrTGame[6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
			if(preWin < intBalance){	//補貨計算
				strCon += "<br /><a class=\"G_Con_Balance\">"+strBalanceText+Math.floor((intBalance - preWin)/flOdds).toString()+"</a>";
			}

			objOTD.innerHTML = strCon;
		}

		document.getElementById("TwinSumStake"+intBT).innerHTML = sumSuppleStake[intBT];
		intTwinSumStake += sumSuppleStake[intBT];
	} //for(intBT = 7; intBT <= 13; intBT++){
	document.getElementById("TwinSumStake").innerHTML = intTwinSumStake;
}


//二定位總排名 初始化
function iniTwinNumberSort(){
	var strNum = "", objOddsTB, intBT, intNo;
	document.getDataForm.OtherMsg.value = "AllSort";
	if(null != document.getElementById("TwinTypeSortTD"))return GetOdds();

	document.getElementById("ListStatus").innerHTML = strT1;
	document.getElementById("BetList").innerHTML = strLayer1Sort;
	document.getElementById("TwinBT0").checked = true;
	objOddsTB = document.getElementById("OddsTable");

	with(objOddsTB)	{
		for(intNo = 0; intNo < 30; intNo++){
			newTR = insertRow();
			newTR.className = "G_Con_TR";
			newTR.align = "center";
			
			with(newTR){
				newTD = insertCell();
				newTD.innerHTML = intNo;

				for(intBT = 1; intBT <= 6; intBT++){
					if(intNo == 0){
						newTD = insertCell();
						newTD.rowSpan = 30;
						newTD.innerHTML = "&nbsp;";
					}

					newTD = insertCell();
					newTD.id = 'Num'+intBT+'_'+intNo;
					newTD.innerHTML = "00";

					newTD = insertCell();
					newTD.id = 'OddsTD'+intBT+'_'+intNo;
					newTD.innerHTML = "&nbsp;";
				}
			}
		}
	}
	GetOdds();
}

//顯示 二定位總排名 賠率表
function ShowTwinNumberSort(){
	var intNum, strNum, arrTmpGame = new Array(), objOTD, objNTD, intTmp = 0, preWin = 0, preWin2 = 0, strClass = "", intBT, intNo, intTwinSumStake = 0, flOdds = 0, isReData = "", intStake = 0, strLNum = "", strRNum = "", strShowNum = "";

	intBalance = parseInt(document.getElementById("BalanceValue").value);
	isReData = document.MultiOddsLayer.isRefreshData.value;
	document.MultiOddsLayer.isRefreshData.value = "0";
	for(intBT = 1; intBT <= 6; intBT++){
		arrTmpGame = eval("Game" + intBT.toString());
		for(intNo = 0; intNo < 30; intNo++){
			var arrTGame = arrTmpGame[intNo];
			intNum = arrTGame[3];
			strNum = intNum.toString();

			flOdds = parseFloat(arrTGame[5]);
			intTmp = parseFloat(arrTGame[9]) + parseFloat(arrTGame[8]);
			intTmp2 = parseFloat(arrTGame[13]) + parseFloat(arrTGame[12]);
			preWin2 = intTmp2 - sumSuppleStake[intBT] + sumSuppleCommission[intBT]; //派彩所得 - 總下注金額 + 所有退水
			preWin = sumStake[intBT] - intTmp - sumCommission[intBT] + preWin2;
			strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

			objNTD = document.getElementById("Num"+intBT.toString()+"_"+intNo.toString());
			objOTD = document.getElementById("OddsTD"+intBT.toString()+"_"+intNo.toString());

			strCon = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:intSortSite=0;ShowOddsLayer("+arrTGame[1]+", "+intBT+", "+intNum+", "+flOdds+", "+arrTGame[4]+","+Math.floor(parseFloat(arrTGame[8]) - parseFloat(arrTGame[12]))+",0,"+intNo+")\">"+flOdds+"</a>";

			strCon += "<br /><a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTGame[1]+","+arrTGame[2]+","+intNum+",0,"+intNo+")\">"+arrTGame[11]+"/"+Math.round(parseFloat(arrTGame[12])).toString()+"</a>";

			strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

			strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
			strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

			if(strNum.length == 1)strNum = "0" + strNum;
			strLNum = strNum.substr(0,1);
			strRNum = strNum.substr(1,1);
			switch(intBT){
				case 1:
					strShowNum = strLNum + strRNum + "xx";
					break;

				case 2:
					strShowNum = strLNum + "x" + strRNum + "x";
					break;

				case 3:
					strShowNum = strLNum + "XX" + strRNum;
					break;

				case 4:
					strShowNum = "x" + strLNum + strRNum + "x";
					break;

				case 5:
					strShowNum = "x" + strLNum + "x" + strRNum;
					break;

				case 6:
					strShowNum = "xx" + strLNum + strRNum;
					break;
			}
			if(null == objNTD)alert(intBT.toString()+"_"+intNo.toString());
			objNTD.innerHTML = "<a href=\"JavaScript:intSortSite=0;ShowOddsLayer("+arrTGame[1]+", "+intBT+", "+intNum+", "+flOdds+", "+arrTGame[4]+","+Math.floor(parseFloat(arrTGame[8]) - parseFloat(arrTGame[12]))+",0,"+intNo+")\" class='G_Con_Numer_blue' id='NumSB"+intBT.toString()+"_"+intNo.toString()+"'>" + strShowNum + "</a>";

			objNTD.className = "G_Con_TD_Ball";
			objOTD.className = (arrTGame[6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";
			if(isGetSuppleOdds == "Y")objOTD.className = (arrTGame[6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
			if(preWin < intBalance){	//補貨計算
				strCon += "<br /><a class=\"G_Con_Balance\">"+strBalanceText+Math.floor((intBalance - preWin)/flOdds).toString()+"</a>";
			}

			objOTD.innerHTML = strCon;
		}

		document.getElementById("TwinSumStake"+intBT).innerHTML = sumSuppleStake[intBT];
		intTwinSumStake += sumSuppleStake[intBT];
	} //for(intBT = 1; intBT <= 6; intBT++){
	document.getElementById("TwinSumStake").innerHTML = intTwinSumStake;
}


//雙飛 初始化
function iniTwinNumber(intBT){
	var strNum = "", strLNum = "", strRNum = "", strShowNum = "";
	document.getDataForm.OtherMsg.value = "";
	document.getElementById("ListStatus").innerHTML = (strBetType == "12")?strT12:(strT1 + "-" + arrTwin[intBT]);
	document.getElementById("BetList").innerHTML = strLayer1;
	//if(document.getElementById("Num1_99").innerHTML == "99"){
		for(var i = 0; i <= 99; i++){
			if(strBetType == "12"){
				if(Math.floor(i / 10) > (i % 10)){
					document.getElementById("Num1_"+i.toString()).innerHTML = "";
					continue;
				}
			}

			strNum = i.toString();
			if(i < 10)strNum = "0" + strNum;
			strLNum = strNum.substr(0,1);
			strRNum = strNum.substr(1,1);
			switch(intBT){
				case 1:
					strShowNum = strLNum + strRNum + "xx";
					break;

				case 2:
					strShowNum = strLNum + "x" + strRNum + "x";
					break;

				case 3:
					strShowNum = strLNum + "xx" + strRNum;
					break;

				case 4:
					strShowNum = "x" + strLNum + strRNum + "x";
					break;

				case 5:
					strShowNum = "x" + strLNum + "x" + strRNum;
					break;

				case 6:
					strShowNum = "xx" + strLNum + strRNum;
					break;

				default:
					strShowNum = strNum;
					break;
			}
			document.getElementById("Num1_"+i.toString()).innerHTML = "<a href='JavaScript:void(0)' class='G_Con_Numer_blue' id='NumLink1_"+i.toString()+"'>" + strShowNum + "</a>";
		}
	//}
	if(strBetType == "12"){
		document.getElementById("TwinTypeTD").style.display = "none";
	}else{
		document.getElementById("TwinBT"+intBT).checked = true;
	}
	GetOdds();
}

//顯示 雙飛 賠率表
function ShowTwinNumber(intBT){
	var intNum, arrTmpGame = new Array(), objOTD, objNTD, sumOdds = 0, minPayOff = 0, intTmp = 0, intTmp2 = 0, intBT, preWin = 0, preWin2 = 0, strClass = "", strCon = "", intBalance = 0, flOdds = 0, isReData = "", intStake = 0;
	var arrN = new Array(-1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000, -1000000000);

	//雙飛
	intBalance = parseInt(document.getElementById("BalanceValue").value);
	isReData = document.MultiOddsLayer.isRefreshData.value;
	document.MultiOddsLayer.isRefreshData.value = "0";
	arrTmpGame = eval("Game" + intBT.toString());
	for(intNum = 0; intNum <= 99; intNum++){
		if(strBetType == "12"){
			if(Math.floor(intNum / 10) > (intNum % 10))continue;
		}

		flOdds = parseFloat(arrTmpGame[intNum][5]);
		sumOdds += 1 / parseFloat(arrTmpGame[intNum][5]);
		intTmp = parseFloat(arrTmpGame[intNum][9]) + parseFloat(arrTmpGame[intNum][8]);
		intTmp2 = parseFloat(arrTmpGame[intNum][13]) + parseFloat(arrTmpGame[intNum][12]);
		preWin2 = intTmp2 - sumSuppleStake[intBT] + sumSuppleCommission[intBT]; //派彩所得 - 總下注金額 + 所有退水
		preWin = sumStake[intBT] - intTmp - sumCommission[intBT] + preWin2;
		strClass = (preWin2 > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";

		strTDSite = "1_" + intNum.toString();

		document.getElementById("NumLink"+strTDSite).href = "JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+intNum+", "+arrTmpGame[intNum][5]+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intNum+");";

		strCon = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:intSortSite=0;ShowOddsLayer("+arrTmpGame[intNum][1]+", "+intBT+", "+intNum+", "+flOdds+", "+arrTmpGame[intNum][4]+","+Math.floor(parseFloat(arrTmpGame[intNum][8]) - parseFloat(arrTmpGame[intNum][12]))+",0,"+intNum+")\">"+flOdds+"</a>";

		strCon += "<br /><a class=\"G_Con_Bet\" href=\"JavaScript: intSortSite=0;getWagerData("+arrTmpGame[intNum][1]+","+arrTmpGame[intNum][2]+","+intNum+",0,"+intNum+")\">"+arrTmpGame[intNum][11]+"/"+Math.round(parseFloat(arrTmpGame[intNum][12])).toString()+"</a>";

		strCon += "<br /><a class=\""+strClass+"\">"+Math.round(preWin2).toString()+"</a>";

		strClass = (preWin > 0)?"G_Con_Result_Win":"G_Con_Result_Lose";
		strCon += "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:void(0)\">&nbsp;/&nbsp;</a><a class=\""+strClass+"\">"+Math.round(preWin).toString()+"</a>";

		objNTD = document.getElementById("Num1_"+intNum.toString());
		objOTD = document.getElementById("OddsTD1_"+intNum.toString());

		arrN = ValueSort(arrN, preWin*intSortPlus, intNum, strCon);

		objNTD.className = "G_Con_TD_Ball";
		objOTD.className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark":"G_Con_TD_Odds";
		if(isGetSuppleOdds == "Y")objOTD.className = (arrTmpGame[intNum][6] == "1")?"G_Con_TD_Dark_Y":"G_Con_TD_Light_Y";
		if(preWin < intBalance){	//補貨計算
			strCon += "<br /><a class=\"G_Con_Balance\">"+strBalanceText+Math.floor((intBalance - preWin)/flOdds).toString()+"</a>";
		}
		objOTD.innerHTML = strCon;
		if(minPayOff > intTmp2)minPayOff = intTmp2;
	}
	document.getElementById("TwinSumStake").innerHTML = sumSuppleStake[intBT];

	changSortClass();
	document.getElementById("MaxLose").innerHTML = Math.round(minPayOff + sumSuppleCommission[intBT] - sumSuppleStake[intBT]);
	for(var i = 0; i < arrSpecialNum.length; i++){
		intNum = arrSpecialNum[i];
		objPNTD = document.getElementById("Num1_"+intNum.toString());
		objPOTD = document.getElementById("OddsTD1_"+intNum.toString());
		objNTD = document.getElementById("NumSort1_"+(i+1).toString());
		objOTD = document.getElementById("OddsTDSort1_"+(i+1).toString());

		arrSpecialCon[i] = arrSpecialCon[i].replace("intSortSite=0", "intSortSite="+(i+1));
		arrSpecialCon[i] = arrSpecialCon[i].replace("intSortSite=0", "intSortSite="+(i+1));
		objNTD.innerHTML = objPNTD.innerHTML;
		objNTD.innerHTML = objNTD.innerHTML.replace("intSortSite=0", "intSortSite="+(i+1));
		objNTD.innerHTML = objNTD.innerHTML.replace("NumLink", "SortNumLink");
		objOTD.innerHTML = arrSpecialCon[i];
		objNTD.className = objPNTD.className+"_Sort";
		objOTD.className = objPOTD.className+"_Sort";
	}
}

//雙飛 重置
function ResetTwinNumber(){
	document.OddsListForm.reset();
}

function ChangeType(intBT, intNum){
	switch(intBT){
		case 1:
		case 2:
		case 3:
		case 4:
		case 5:
		case 6:
		case 12:
			return (intNum < 10)?"0"+intNum.toString():intNum.toString();
			break;

		case 14:
			return (intNum % 10 == 0)?"<?php print $_strSame_String[Odd];//單?>":"<?php print $_strSame_String[Even];//雙?>";
			break;

		case 15:
			return (intNum %10 == 0)?"<?php print $_strSame_String[Over];//大?>":"<?php print $_strSame_String[Under];//小?>";
			break;

		case 16:
			return (intNum %10 == 0)?"<?php print $_strSame_String[SOdd];//合單?>":"<?php print $_strSame_String[SEven];//合雙?>";
			break;

		case 17:
			return (intNum %10 == 0)?"<?php print $_strSame_String[SOver];//合大?>":"<?php print $_strSame_String[SUnder];//合小?>";
			break;

		case 84:
		case 85:
		case 86:
			return (intNum %10 == 0)?"<?php print $_strSame_String[Prime];//大?>":"<?php print $_strSame_String[Composite];//小?>";
			break;

		case 7:
		case 8:
		case 9:
		case 10:
		case 13:
			if(intNum < 10){
				return "00"+intNum.toString();
			}else if(intNum < 100){
				return "0"+intNum.toString();
			}
			return intNum.toString();
			break;

		case 11:
			if(intNum < 10){
				return "000"+intNum.toString();
			}else if(intNum < 100){
				return "00"+intNum.toString();
			}else if(intNum < 1000){
				return "0"+intNum.toString();
			}
			return intNum.toString();
			break;

		default:
			return intNum;
			break;
	}
}

function ChangeNumber(intNum){
	var strTmp = "";
	for (var i = 0; i < intNum.length; i++){
		strTmp += intNum.charAt(i).toString();
		if(i % 2 == 1 && i < (intNum.length - 1))strTmp += ",";
	}
	return strTmp.replace("00,", "");
}
//顯示賠率視窗
function ShowOddsLayer(intGID, intBT, intNum, flOdds, intOID, intMaxStake, flStake, intSiteNum){
	var strTD = "", arrTmpGame, j;
	var strSNType = document.getDataForm.SpecialNumType.value;
	document.getElementById("WBetTypeTD").innerHTML = arrBetType[intBT];

	switch(parseInt(intBT)){
		case 14:
		case 15:
		case 16:
		case 17:
		case 18:
		case 19:
		case 20:
		case 21:
		case 22:
			strTD = "WagerTD"+intBT+"_"+intSiteNum;
			break;

		case 1:
		case 2:
		case 3:
		case 4:
		case 5:
		case 6:
		case 12:
			if(document.getDataForm.OtherMsg.value == "AllSort"){
				strTD = "OddsTD"+intBT+"_"+intSiteNum;
			}else{
				strTD = "OddsTD1_"+intSiteNum;
			}
			break;

		case 7:
		case 8:
		case 9:
		case 10:
			if(document.getDataForm.OtherMsg.value == "AllSort"){
				strTD = "OddsTD"+intBT+"_"+intSiteNum;
			}else{
				strTD = "OddsTD7_"+intSiteNum;
			}
			break;

		default:
			strTD = "OddsTD"+intBT+"_"+intSiteNum;
			break;
	}
	if(intNum.toString() != "")WNumberTD.innerHTML = ChangeType(intBT, intNum);
	if(isNaN(intNum)){
		document.getElementById("odds_win").style.top = document.getElementById(strTD).offsetTop + document.getElementById(strTD).clientHeight + 18 + document.getElementById("supple_wager_win").offsetTop;
		document.getElementById("odds_win").style.left = document.getElementById(strTD).offsetLeft + document.getElementById(strTD).clientWidth + 2;
	}else{
		if(document.getElementById(strTD)){
			document.getElementById("odds_win").style.top = document.getElementById(strTD).offsetTop + document.getElementById(strTD).clientHeight + 56;
			document.getElementById("odds_win").style.left = document.getElementById(strTD).offsetLeft;
		}else{
			document.getElementById("odds_win").style.top = 175;
			document.getElementById("odds_win").style.left = 510;
		}
	}
	if(document.getElementById(strTD) && (document.getElementById("OddsTable").clientWidth < document.getElementById(strTD).offsetLeft + 180)){
		document.getElementById("odds_win").style.left = parseInt(document.getElementById("odds_win").style.left) + document.getElementById(strTD).clientWidth - 185;
	}

	document.getElementById("odds_win").style.display = "block";
	with(document.OddsLayer){
		op.value = "Wager";
		GambleID.value = intGID;
		Bet_Type.value = intBT;
		Odds.value = Math.round(flOdds*1000)/1000;
		OddsID.value = intOID;
		StakeMoney.value = "";
		Number.value = intNum;
		StakeMoney.focus();
	}
	close_WagerWin();
}
//關閉賠率視窗
function close_MultiOddsWin(){
	document.getElementById("multiodds_win").style.display = "none";
}
function open_MultiOddsWin(intBT){
	document.MultiOddsLayer.isRefreshData.value = "1";
	document.getElementById("MultiWagerType").innerHTML = arrBetType[intBT];
	setBalanceCookie(intBT);
	RefreshType();
	document.MultiOddsLayer.Bet_Type.value = intBT;
	document.getElementById("multiodds_win").style.display = "block";
	document.getElementById("multiodds_win").style.left = 100;
	document.getElementById("multiodds_win").style.top = 100;
}
//關閉賠率視窗
function close_OddsWin(){
	document.getElementById("odds_win").style.display = "none";
}
//關閉明細視窗
function close_WagerWin(){
	document.getElementById("wager_win").style.display = "none";
}
//關閉明細視窗
function close_SuppleWagerWin(){
	document.getElementById("supple_wager_win").style.display = "none";
}
//關閉補貨結果視窗
function close_SuppleResultWin(){
	document.getElementById("supple_result_win").style.display = "none";
}
function open_SuppleResultWin(){
	document.getElementById("supple_result_win").style.top = document.body.scrollTop + 50;
	document.getElementById("supple_result_win").style.left = (screen.width - parseInt(document.getElementById("supple_result_win").style.width)) / 2;
	document.getElementById("supple_result_win").style.display = "block";
}
//取得賠率樣版
function GetTemplate(){
	if(strLayer010203)return;
	with(document.getDataForm){
		op.value = "GetTemplate";
		submit();
	}
}

//取得賠率
function GetOdds(){
	with(document.getDataForm){
		document.getDataForm["Bet_Type"].value = strBetType;
		op.value = "GetOdds";
		submit();
	}
}

/*--判斷特定欄位值是否有填--*/
function isEmpty(str) { 
	for (var i = 0; i < str.length; i++)
		if (" " != str.charAt(i))return false; 
		return true; 
}

function checkOdds(){
	var objOdds = document.OddsLayer.Odds;
	var intBetType = parseInt(document.OddsLayer.Bet_Type.value);
	window.status = document.OddsLayer.Bet_Type.value;
	if(isEmpty(objOdds.value)){
		alert("Odds is Empty");
		objOdds.focus();
		return false;
	}else if(isNaN(objOdds.value)){
		alert("Odds is String!!");
		objOdds.focus();
		return false;
	}else if(parseFloat(objOdds.value) <= 1){
		alert("Odds <= 1");
		objOdds.focus();
		return false;
	}
	if(document.OddsLayer.JNNumber){
		if(isEmpty(document.OddsLayer.JNNumber.value)){
			alert("Number is Empty");
			document.OddsLayer.JNNumber.focus();
			return false;
		}
		document.OddsLayer.Number.value = document.OddsLayer.JNNumber.value;
	}
	if(intBetType == 30){
		var arrN = new Array(), j = 0;
		for(var i = 1; i <= 12; i++){
			if(document.OddsLayer["WChoiceNumber["+i+"]"].checked){
				arrN[j] =  document.OddsLayer["WChoiceNumber["+i+"]"].value;
				j++;
			}
		}
		if(j != 6){
			alert("Please click 6 animals!!");
			document.OddsLayer["WChoiceNumber[1]"].focus();
			return false;
		}
		document.OddsLayer.ChoiceNumber.value = arrN.join(",");
	}
	close_OddsWin();
	return true;
}

function checkMultiOdds(){
	var i = 0, objOdds, objStake, isStake = false;
	for(i = 1; i < 50; i++){
		objOdds = document.MultiOddsLayer["arrOdds["+i+"]"];
		objStake = document.MultiOddsLayer["arrStake["+i+"]"];
		if(isEmpty(objOdds.value) && !isEmpty(objStake.value)){
			alert("Odds of Number "+i+" is Empty");
			objOdds.focus();
			return false;
		}
		if(!isEmpty(objOdds.value) && !isEmpty(objStake.value)) {
			if(isNaN(objOdds.value)){
				alert("Odds of Number "+i+" is String!!");
				objOdds.focus();
				return false;
			}else if(parseFloat(objOdds.value) <= 1){
				alert("Odds of Number "+i+" <= 1");
				objOdds.focus();
				return false;
			}else if(isNaN(objStake.value)){
				alert("Stake Money of Number "+i+" is String!!");
				objOdds.focus();
				return false;
			}else if(parseFloat(objStake.value) <= 0){
				alert("Stake Money of Number "+i+" <= 0");
				objOdds.focus();
				return false;
			}
			isStake = true;
		}	//if(!isEmpty(objOdds.value) && !isEmpty(objStake.value))
	}	//for(i = 1; i < 50; i++)
	if(!isStake){
		alert("Please input Stake Money!!");
		document.MultiOddsLayer["arrStake[1]"].focus();
		return false;
	}
	close_MultiOddsWin();
	return true;
}

//給選擇樂透種類下拉選單用
function LottoSelect(){
	with(document.OddsListForm){
		target = "_self";
		switch(LottoID.value){
			case "1":
				action = "/k_admin/Supplement/index.php";
				break;

			case "2":
			case "3":
				action = "/k_admin/Supplement3D/index.php";
				break;

			case "7":
				action = "/k_admin/Supplement7Star/index.php";
				break;
		}
		submit();
	}
}

function ReChangeBet(){
	ChangeBet(intChangeBT);
}

//更改下注種類賠率表
function ChangeBet(intBT){
	close_WagerWin();
	close_SuppleWagerWin();
	close_OddsWin();
	close_MultiOddsWin();
	close_SuppleResultWin();
	//document.getElementById("SelectNS").style.display = "none";
	//document.getElementById("SelectSpLine").style.display = "none";
	document.getDataForm.SpecialNumType.value = "0";
	document.OddsLayer.SpecialNumType.value = "0";
	document.MultiOddsLayer.SpecialNumType.value = "0";
	document.getDataForm["isSpecial"].value = 0;
	intChangeBT = intBT;
	document.getDataForm.OtherMsg.value = "";
	switch(intBT){
		// 定位
		case 18:
			document.getElementById("ListStatus").innerHTML = strT18;
			strBetType = "14,15,18,19,20,21,22";
			document.getDataForm["Bet_Type"].value = "14,15,18,19,20,21,22";
			iniNumber(18);
			break;

		//二定位
		case 1:
		case 2:
		case 3:
		case 4:
		case 5:
		case 6:
			document.getElementById("ListStatus").innerHTML = strT1;
			strBetType = intBT;
			document.getDataForm["Bet_Type"].value = intBT;
			iniTwinNumber(intBT);
			document.getElementById("TwinTip1").className =  "";
			document.getElementById("TwinTip2").className =  "";
			document.getElementById("TwinTip3").className =  "";
			document.getElementById("TwinTip4").className =  "";
			document.getElementById("TwinTip5").className =  "";
			document.getElementById("TwinTip6").className =  "";
			document.getElementById("TwinTip"+intBT).className =  "G_Con_St_Trinity";
			break;

		//二定位總排名
		case 0:
			document.getElementById("ListStatus").innerHTML = strT1;
			strBetType = "1,2,3,4,5,6";
			document.getDataForm["Bet_Type"].value = strBetType;
			iniTwinNumberSort();
			var objTwinTip = document.getElementById("TwinTip0");
			objTwinTip.style.color = "#FF9900";
			objTwinTip.style.fontSize = "16px";
			objTwinTip.style.fontWeight = "700";
			getBalanceCookie(0);
			break;

		//二字
		case 12:
			document.getElementById("ListStatus").innerHTML = strT12;
			strBetType = intBT;
			document.getDataForm["Bet_Type"].value = intBT;
			iniTwinNumber(intBT);
			getBalanceCookie(intBT);
			break;

		//合數單雙大小
		case 16:
			document.getElementById("ListStatus").innerHTML = strT16;
			strBetType = "16,17";
			document.getDataForm["Bet_Type"].value = "16,17";
			iniNumber(16);
			break;

		//三定位總排名
		case 713:
			document.getElementById("ListStatus").innerHTML = strTAll7;
			strBetType = "7,8,9,10,12,13";
			document.getDataForm["Bet_Type"].value = strBetType;
			iniTrinityNumberSort();
			getBalanceCookie(713);
			break;

		// 三定位
		case 7:
		case 8:
		case 9:
		case 10:
			document.getElementById("ListStatus").innerHTML = eval("strT"+intBT);
			strBetType = intBT;
			document.getDataForm["Bet_Type"].value = intBT;
			iniTrinityNumber(intBT);
			getBalanceCookie(intBT);
			break;

		// 四定位
		case 11:
			document.getElementById("ListStatus").innerHTML = strT11;
			strBetType = intBT;
			document.getDataForm["Bet_Type"].value = intBT;
			iniFourNumber(intBT);
			getBalanceCookie(intBT);
			break;

		//三字
		case 13:
			document.getElementById("ListStatus").innerHTML = strT13;
			strBetType = intBT;
			document.getDataForm["Bet_Type"].value = intBT;
			ini3WordNumber(intBT);
			getBalanceCookie(intBT);
			break;
	}
}

//更改分盤顯示
function ChangeGambleType(obj){
	with(document.getDataForm){
		ChangeGameType.value = "Yes";
		GameType.value = obj.value;
		submit();
		ChangeGameType.value = "No";
	}
}
//重整方式
function RefreshType(){
	with(document.getDataForm){
		if(op.value == "StartGame"){
			StartGame();
		}else{
			GetOdds();
		}
	}
}
//定時重整
function RClock(i){
	if (RSeconds == 0){
		RefreshType();
		RSeconds = i;
	}
	RSeconds --;
	if(document.getElementById("RSec"))document.getElementById("RSec").innerHTML = RSeconds;
}
//顯示虛貨，實貨方式
function ChangeReal(obj){
	document.getDataForm.isRealShow.value = 1;//obj.value;
	document.OddsLayer.isRealShow.value = 1;//obj.value;
	RefreshType();
}
//選擇定時時間
function ChangeRefreshSec(obj){
	if(AutoRefreshID > 0)clearInterval(AutoRefreshID);
	AutoRefreshID = setInterval("RClock("+obj.value+")",1000);
}
//批次用賠率差調整賠率
function PlusMinusOdds(isAdd, intNum, intBT, flOdds){
	with(document.OddsLayer){
		op.value = "OddsUpdate";
		GapOdds.value = ((isAdd == 1)?"":"-")+arrJumpOdds[intBT];
		Odds.value = flOdds + parseFloat(GapOdds.value);
		intNumber.value = intNum;
		GambleID.value = document.getDataForm.GambleID.value;
		isSpecial.value = document.getDataForm.isSpecial.value;
		Bet_Type.value = intBT;
		submit();
	}
}
var KGameDOM;
function getWagerData(GID, BID, Num, isStop, CellNum) {
	var KGame = new Array(), strTD = "", intGap = 56;
	var objWTable = document.getElementById("WagerTable");
	var objWLayer = document.getElementById("WagerLayer");
	var strBID = BID;
	var docloc="getWager.xml.php?GambleID="+GID+"&Bet_Type="+strBID+"&Number="+Num+"&isStop="+isStop+"&isRealShow="+document.getDataForm.isRealShow.value;

	if (document.implementation && document.implementation.createDocument) {
		KGameDOM = document.implementation.createDocument("", "", null);
	} else if (window.ActiveXObject) {
		KGameDOM = new ActiveXObject("Microsoft.XMLDOM");
		KGameDOM.async = false;
	}
	KGameDOM.load(docloc);
	var root = KGameDOM.documentElement;

	if(root != null){
		if(Num == -1){
			strTD = "OddsTD"+BID;
		}else{
			switch(BID){
				case 18:
				case 19:
				case 20:
				case 21:
				case 22:
					strTD = "WagerTD"+BID+"_"+CellNum;
					break;

				case 1:
				case 2:
				case 3:
				case 4:
				case 5:
				case 6:
					strTD = "OddsTD1_"+CellNum;
					break;

				case 7:
				case 8:
				case 9:
				case 10:
					strTD = "OddsTD7_"+CellNum;
					break;

				default:
					strTD = "OddsTD"+BID+"_"+CellNum;
					break;
			}
		}
		document.getElementById("wager_win").style.top = document.getElementById(strTD).offsetTop + document.getElementById(strTD).clientHeight+intGap;
		if(document.getElementById("OddsTable").clientWidth < document.getElementById(strTD).offsetLeft + 483){
			document.getElementById("wager_win").style.left = document.getElementById(strTD).offsetLeft + document.getElementById(strTD).clientWidth - 487;
		}else{
			document.getElementById("wager_win").style.left = document.getElementById(strTD).offsetLeft;
		}
		document.getElementById("wager_win").style.display = "block";
		close_OddsWin();
		close_SuppleResultWin();
	}else{
		close_WagerWin();
		close_SuppleResultWin();
		return;
	}
	with(objWTable)	{
		while(rows.length > 1)	deleteRow(rows.length - 1);

		for (var i = 0; i < root.childNodes.length; i++) {
			newTR = insertRow();
			newTR.className = "Account_Con_BG";
			with(newTR){
				if (root.childNodes.item(i).tagName == "WagerData") {
					KGame[i]=root.childNodes.item(i);
					newTD = insertCell();
					newTD.align = "left";
					newTD.innerHTML = KGame[i].getElementsByTagName("BetDate").item(0).text + "&nbsp;" + KGame[i].getElementsByTagName("BetTime").item(0).text + "<br />" + KGame[i].getElementsByTagName("BetNo").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("Account").item(0).text;

					newTD = insertCell();
					newTD.innerHTML = KGame[i].getElementsByTagName("Content").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					if(KGame[i].getElementsByTagName("OneStake").item(0).text != ""){
						newTD.innerHTML = KGame[i].getElementsByTagName("OneStake").item(0).text + "<br /><br />" + KGame[i].getElementsByTagName("Stake").item(0).text;
					}else{
						newTD.innerHTML = KGame[i].getElementsByTagName("Stake").item(0).text;
					}

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("Income").item(0).text;
				}
			}
		}
	}
	objWLayer.style.height = (objWTable.clientHeight > 300)?300:objWTable.clientHeight;
}

function setBalanceCookie(intBT){
	SetCookie("7StarBalanceValue"+intBT, document.getElementById("BalanceValue").value, 1, null, null, null);
	SetCookie("7StarBalanceOdds"+intBT, document.getElementById("BalanceOdds").value, 1, null, null, null);
}

function getSuppleWagerData(intBT) {
	var KGame = new Array(), strTD = "", intGap = 0, strJWType = "", strJWNumber = "", strNumber = "", strJoinNumber = "";
	var objWTable = document.getElementById("SuppleWagerTable");
	var objWLayer = document.getElementById("SuppleWagerLayer");

	var arrTmpGame = eval("Game" + strJWType);
	document.OddsLayer.Odds.value = arrTmpGame[0][5];
	document.OddsLayer.OddsID.value = arrTmpGame[0][4];
	if(arrTmpGame.length > 1){
		document.OddsLayer.Odds2.value = arrTmpGame[1][5];
		document.OddsLayer.OddsID2.value = arrTmpGame[1][4];
	}
	var strGID = document.getDataForm.GambleID.value;
	var strBValue = document.getElementById("BalanceValue").value;
	var strBOdds = document.getElementById("BalanceOdds").value;

	var docloc="getSuppleJW.xml.php?GambleID="+strGID+"&Bet_Type="+strJWType+"&Number="+strJWNumber+"&isRealShow="+document.getDataForm.isRealShow.value+"&BValue="+strBValue+"&BOdds="+strBOdds;

	if (document.implementation && document.implementation.createDocument) {
		KGameDOM = document.implementation.createDocument("", "", null);
	} else if (window.ActiveXObject) {
		KGameDOM = new ActiveXObject("Microsoft.XMLDOM");
		KGameDOM.async = false;
	}
	KGameDOM.load(docloc);
	var root = KGameDOM.documentElement;

	if(root != null){
		document.getElementById("supple_wager_win").style.display = "block";
		close_OddsWin();
		close_WagerWin();
		close_SuppleResultWin();
	} //if(root != null)

	with(objWTable)	{
		while(rows.length > 1)	deleteRow(rows.length - 1);

		for (var i = 0; i < root.childNodes.length; i++) {
			newTR = insertRow();
			newTR.className = "Account_Con_BG";
			with(newTR){
				if (root.childNodes.item(i).tagName == "WagerData") {
					KGame[i]=root.childNodes.item(i);
					newTD = insertCell();
					newTD.align = "center";
					newTD.innerHTML = (i + 1).toString();

					strNumber = KGame[i].getElementsByTagName("Number").item(0).text;
					newTD = insertCell();
					newTD.align = "left";

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("WagerCount").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("MemPayOff").item(0).text;
					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = KGame[i].getElementsByTagName("MemPayOff2").item(0).text;

					newTD = insertCell();
					newTD.align = "right";
					newTD.innerHTML = Math.round((parseFloat(KGame[i].getElementsByTagName("MemPayOff").item(0).text) + parseFloat(strBValue)) / parseFloat(strBOdds));

					newTD = insertCell();
					newTD.id = strBTD_ID;
					newTD.align = "center";
					newTD.innerHTML = "<a class=\"G_Con_Odds_NoLink\" href=\"JavaScript:ShowOddsLayer("+strGID+", "+strJWType+", '"+strNumber+"', "+strBOdds+", '"+arrTmpGame[0][4]+"', '"+strJoinNumber+"')\"><?php print $_strSupplement7S["Supple"];//補貨?></a>";
				}
			}
		}
	}
	objWLayer.style.height = (objWTable.clientHeight > 300)?300:objWTable.clientHeight;
}

function getBalanceCookie(intBT){
	var strT = GetCookie("7StarBalanceValue"+intBT);
	if(strT == "" || strT == null){
		document.getElementById("BalanceValue").value = -500000000;
		document.getElementById("BalanceOdds").value = 1;
	}else{
		document.getElementById("BalanceValue").value = GetCookie("7StarBalanceValue"+intBT);
		document.getElementById("BalanceOdds").value = GetCookie("7StarBalanceOdds"+intBT);
	}
}

//-->
</script>
</head>

<body class="Mybody" onload="ChangeBet(0);">
<form action="index.php" target="_self" method="Get" name="OddsListForm">
<table class="G_Table" cellspacing="1" cellpadding="0">
<tr>
	<td colspan="10" class="MyUp">
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td align="right" class="G_Menu">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size: 1px">
	<tr>
		<td align="left"><a class="G_text" style="font-size: 13px; font-weight: 700"><?php print $_strSupplement7S["Title"];?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="G_text"><?php print $_strSupplement7S["LottoKind"];//種類：?><?php print MakeLottoSelect($_arrLotto, $intLottoID, "LottoID", "LottoSelect()", $_intLang)?></a></td>
		<td align="left">
		<a class="G_text"><?php print $_strSupplement7S["RefreshWay"];//更新：?></a>
		<select onchange="ChangeRefreshSec(this)">
			<option value="">-No-</option>
			<option value="5">5 sec</option>
			<option value="10">10 sec</option>
			<option value="20">20 sec</option>
			<option value="30">30 sec</option>
			<option value="40">40 sec</option>
			<option value="50">50 sec</option>
			<option value="60">60 sec</option>
		</select>&nbsp;<input type="button" class="submit" value="<?php print $_strSupplement7S["Reset"];//重新整理?>" onclick="RefreshType();"> </td>
		<td align="left"><a class="G_text"><?php print $_strSupplement7S["LineKind"];//分盤：?></a>
		<select name="GambleType" onchange="ChangeGambleType(this)">
		<?php
			$arrLine = split(",", $_KSysParam[GambleLineShowSetting]);
			foreach($arrLine as $k => $v){
				if(empty($v) || ($_data["isGetSuppleOdds"] == "Y" && $k != 1))continue;
				if($_data["GameType"] == $k){
					print '<option value="'.$k.'" selected>'.$v.'</option>\n';
				}else{
					print '<option value="'.$k.'">'.$v.'</option>\n';
				}
			}
		?>
		</select>
		</td>
		<td align="right" valign="bottom" width="450" style="font-size: 1px">
		<!--########## 定位 ##########//-->
			<a href="JavaScript:ChangeBet(18)" id="M_18" class="while_link"><?php print $_strSupplement7S["Bet18"];//定位?></a>
		<!--########## 二定位 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(0)" id="M_1" class="while_link"><?php print $_strSupplement7S["Bet1"];//二定位?></a>
		<!--########## 三定位 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(713)" id="M_7" class="while_link"><?php print $_strSupplement7S["BetAll7"];//三定位?></a>
		<!--########## 四定位 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(11)" id="M_11" class="while_link"><?php print $_strSupplement7S["Bet11"];//四定位?></a>
		<!--########## 二字 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(12)" id="M_12" class="while_link"><?php print $_strSupplement7S["Bet12"];//二字?></a>
		<!--########## 三字 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(13)" id="M_13" class="while_link"><?php print $_strSupplement7S["Bet13"];//三字?></a>
		<!--########## 合數單雙大小 ##########//-->
			&nbsp;<a class="a_text">|</a>&nbsp;
			<a href="JavaScript:ChangeBet(16)" id="M_16" class="while_link"><?php print $_strSupplement7S["Bet16"];//合數單雙大小?></a>
		</td>
	</tr>
</table>
				</td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td colspan="10" class="G_OutSubMenu">
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td align="right" class="G_SubMenu">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td align="left" class="G_SubMenuCon" width="60%"><?php print $_strSupplement7S["ListStatus"];//目前表單狀態：?><a id="ListStatus" class="G_Sec">Special Ball</a>&nbsp;--&nbsp;<?php print $_strSupplement7S["GameNo"];//期數?><b style="font-size: 16">&nbsp;:&nbsp;</b><a class="G_Sec"><?php print $arrGamble["SerialNo"];?></a>&nbsp;--&nbsp;<?php print $_strSupplement7S["GameTime"];//時間?><b style="font-size: 16">&nbsp;:&nbsp;</b><a class="G_Sec"><?php print $_strGDate;?></a>
		<td align="center" class="G_SubMenuCon">&nbsp;	</td>
		<?php if($_KSysParam[SuppleUrl] != ""){ ?>
		<td align="left" class="G_SubMenuCon" width="20%" style="font-size: 16px; font-weight: 700"><input type="checkbox" name="isGetSuppleOdds" value="Y"<?php print ($_data["isGetSuppleOdds"] == "Y")?" checked":"";?> onclick="document.OddsListForm.submit();" style="width: 15px; height:15px"><?php print $_strSupplement7S["SuppleOdds"];//外調賠率?></td>
		<?php } ?>
		</td>
		<td align="right" class="G_SubMenuCon"><?php print $_strSupplement7S["RefreshSec"];//更新秒數：?><a class="G_Sec" id="RSec">--</a></td>
	</tr>
</table>
				</td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td><span id="BetList"></span></td>
</tr>
</table>
</form>

<!----------------------號碼視窗---------------------------->
<div id="odds_win" style="display: none;position:absolute; z-Index: 5;">
<form name="OddsLayer" action="index.php" method="Get" target="getData" onsubmit="return checkOdds();">
<input type="hidden" name="op" value="Wager">
<input type="hidden" name="rop" value="GetOdds">
<input type="hidden" name="LottoID" value="<?php print $intLottoID;?>">
<input type="hidden" name="SerialNo" value="<?php print $arrGamble["SerialNo"];?>">
<input type="hidden" name="GambleID" value="">
<input type="hidden" name="Bet_Type" value="">
<input type="hidden" name="Number" value="">
<input type="hidden" name="isSpecial" value="1">
<input type="hidden" name="isRealShow" value="1">
<input type="hidden" name="isGetSuppleOdds" value="<?php print $_data["isGetSuppleOdds"];?>">
<input type="hidden" name="GameDate" value="<?php print $arrGamble["GameDate"];?>">
<input type="hidden" name="SpecialNumType" value="3">
<input type="hidden" name="ChoiceNumber" value="">
<table width="300" border="0" cellspacing="1" cellpadding="2" bgcolor="00558E">
<tr>
	<td bgcolor="#FFFFFF">
		<table width="300" border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
			<tr bgcolor="0163A2"> 
				<td width="100" style="font-size:12px"><font color="#FFFFFF">&nbsp;Wager</td>
				<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_OddsWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
			</tr>
			<tr bgcolor="#000000"> 
				<td colspan="2" height="1"></td>
			</tr>
        <tr bgcolor="#FFCC66"> 
          <td colspan="2">
		  <table border="0" cellspacing="1" cellpadding="0" width="300" bgcolor="#FFFFFF">
			  <tr bgcolor="#FFCC66" height="22">
				<td width="50" align="center"><?php print $_strSupplement7S["TipKind"];?></td>
				<td align="left" id="WBetTypeTD" style="font-weight:700; color: #000066; padding-left: 5px">&nbsp;</td>
			  </tr>
			  <tr bgcolor="#FFCC66" height="22">
				<td align="center"><?php print $_strSupplement7S["GameNumber"]?></td>
				<td align="left" id="WNumberTD" style="font-weight:700; color: #000066; padding-left: 5px">&nbsp;</td>
			  </tr>
			  <tr bgcolor="#FFCC66" height="22" id="WChoiceNumberTR" style="display:none">
				<td align="center"><?php print $_strSupplement7S["Animals"];?></td>
				<td align="left" id="WChoiceNumberTD" style="font-weight:700; color: #000066; padding-left: 5px">
				<?php
					foreach($_arrAnimals as $intKey => $strAnumals){
						if($intKey == 0)continue;
						print " <input type='checkbox' name='WChoiceNumber[".$intKey."]' value='".$intKey."'>".$strAnumals;
						if($intKey == 6)print " <br>\n";
					}
				?>
				</td>
			  </tr>
			  <tr bgcolor="#FFCC66">
				<td align="center"><?php print $_strSupplement7S["WAccount"];?></td>
				<td align="left">&nbsp;<select name="MemID"><?php print $strOption;?></select></td>
			  </tr>
			  <tr bgcolor="#FFCC66">
				<td align="center"><?php print $_strSupplement7S["Odds"]?></td>
				<td align="left">&nbsp;<input type="text" name="Odds" size="5" onpaste="return event.returnValue = false;" onfocus="<?php if($_data["isGetSuppleOdds"] == "Y")print "this.blur();";?>"><input type="hidden" name="OddsID" value=""></td>
			  </tr>
			  <tr bgcolor="#FFCC66" style="display: none" id="WagerOdds2">
				<td align="center"><?php print $_strSupplement7S["Odds2"]?></td>
				<td align="left">&nbsp;<input type="text" name="Odds2" size="5" onpaste="return event.returnValue = false;" onfocus="<?php if($_data["isGetSuppleOdds"] == "Y")print "this.blur();";?>"><input type="hidden" name="OddsID2" value=""></td>
			  </tr>
			  <tr bgcolor="#FFCC66">
				<td align="center"><?php print $_strSupplement7S["WStake"]?></td>
				<td align="left">&nbsp;<input type="text" name="StakeMoney" size="10" onpaste="return event.returnValue = false;"></td>
			  </tr>
			  <tr bgcolor="#FFCC66">
				<td align="center" colspan="2"><input type="submit" class="submit" value="<?php print $_strSupplement7S["Send"];?>"></td>
			  </tr>
		  </table>
		  </td>
        </tr>
      </table>
    </td>
</tr>
</table>
</form>
</div>
<!----------------------號碼視窗----------------------------> 
<!----------------------多號碼視窗---------------------------->
<div id="multiodds_win" style="display: none;position:absolute; z-Index: 6;">
<form name="MultiOddsLayer" action="index.php" method="Post" target="getData" onsubmit="return checkMultiOdds();">
<input type="hidden" name="op" value="MultiWager">
<input type="hidden" name="rop" value="GetOdds">
<input type="hidden" name="isRefreshData" value="0">
<input type="hidden" name="LottoID" value="<?php print $intLottoID;?>">
<input type="hidden" name="SerialNo" value="<?php print $arrGamble["SerialNo"];?>">
<input type="hidden" name="GambleID" value="<?php print $intGID;?>">
<input type="hidden" name="Bet_Type" value="1">
<input type="hidden" name="isSpecial" value="1">
<input type="hidden" name="isRealShow" value="1">
<input type="hidden" name="isGetSuppleOdds" value="<?php print $_data["isGetSuppleOdds"];?>">
<input type="hidden" name="GameDate" value="<?php print $arrGamble["GameDate"];?>">
<input type="hidden" name="SpecialNumType" value="3">
<table border="0" cellspacing="1" cellpadding="2" bgcolor="00558E" width="700">
<tr>
	<td bgcolor="#FFFFFF">
	<table border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
	<tr bgcolor="0163A2"> 
		<td style="font-size:12px"><font color="#FFFFFF">&nbsp;Multi Wager</td>
		<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_MultiOddsWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
	</tr>
	<tr bgcolor="#000000"> 
		<td colspan="2" height="1"></td>
	</tr>
	<tr bgcolor="#D8ECE9"> 
		<td colspan="2">
		<table border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td align="left"><table border="0" cellspacing="1" cellpadding="0" style="background-color: #FFFFFF">
			<tr align="center" valign="middle" style="background-color: #D8ECE9; font-size: 12px;">
				<td style="background-color: #7F9DB9;"><?php print $_strSupplement7S["TipKind"];?></td>
				<td width="50" id="MultiWagerType">&nbsp;&nbsp;&nbsp;&nbsp;</td>
				<td style="background-color: #7F9DB9;"><?php print $_strSupplement7S["WAccount"];?></td>
				<td><select name="MemID"><?php print $strOption;?></select></td>
				<?php if($_data["isGetSuppleOdds"] != "Y"){ ?>
				<td style="background-color: #7F9DB9;"><?php print $_strSupplement7S["Odds"];?></td>
				<td><input type="text" name="QOdds" class="s_multi_num_odds"></td>
				<?php } //if($_data["isGetSuppleOdds"] != "Y")?>
				<td style="background-color: #7F9DB9;"><?php print $_strSupplement7S["WStake"];?></td>
				<td><input type="text" name="QStake" class="s_multi_num_num"></td>
				<td align="left">
					<input type="checkbox" name="QOType[0]" value="Red"><a class="G_Con_Text_red"><?php print $_strSupplement7S["RedBall"];//紅波?></a>
					<input type="checkbox" name="QOType[1]" value="Blue"><a class="G_Con_Text_blue"><?php print $_strSupplement7S["BlueBall"];//藍波?></a>
					<input type="checkbox" name="QOType[2]" value="Green"><a class="G_Con_Text_green"><?php print $_strSupplement7S["GreenBall"];//綠波?></a>
					<input type="checkbox" name="QOType[3]" value="Odd"><a class="G_Con_Text_blue"><?php print $_strSupplement7S["OddBall"];//單號?></a>
					<input type="checkbox" name="QOType[4]" value="Even"><a class="G_Con_Text_blue"><?php print $_strSupplement7S["EvenBall"];//雙號?></a><br />
					<input type="checkbox" name="QOType[5]" value="Over"><a class="G_Con_Text_blue"><?php print $_strSupplement7S["OverBall"];//大號?></a>
					<input type="checkbox" name="QOType[6]" value="Under"><a class="G_Con_Text_blue"><?php print $_strSupplement7S["UnderBall"];//小號?></a>
					<input type="checkbox" name="QOType[7]" value="SumOdd"><a class="G_Con_Text_blue"><?php print $_strSupplement7S["SumOddBall"];//合單?></a>
					<input type="checkbox" name="QOType[8]" value="SumEven"><a class="G_Con_Text_blue"><?php print $_strSupplement7S["SumEvenBall"];//合雙?></a>
					<input type="button" value="Go" class="submit" onclick="inputQMultiStake()">
				</td>
			</tr>
			</table></td>
		</tr>
		<tr>
			<td align="center">
			<table border="0" cellspacing="1" cellpadding="3" style="background-color: #FFFFFF" id="MultiOddsTable">
			<tr align="center" valign="bottom" style="background-color: #7F9DB9; font-size: 12px; height: 16px;">
				<td style="width: 40px;"><?php print $_strSupplement7S["GameNumber"]?></td>
				<td><?php print $_strSupplement7S["Odds"]?></td>
				<td><?php print $_strSupplement7S["WStake"]?></td>
				<td style="width: 40px;"><?php print $_strSupplement7S["GameNumber"]?></td>
				<td><?php print $_strSupplement7S["Odds"]?></td>
				<td><?php print $_strSupplement7S["WStake"]?></td>
				<td style="width: 40px;"><?php print $_strSupplement7S["GameNumber"]?></td>
				<td><?php print $_strSupplement7S["Odds"]?></td>
				<td><?php print $_strSupplement7S["WStake"]?></td>
				<td style="width: 40px;"><?php print $_strSupplement7S["GameNumber"]?></td>
				<td><?php print $_strSupplement7S["Odds"]?></td>
				<td><?php print $_strSupplement7S["WStake"]?></td>
				<td style="width: 40px;"><?php print $_strSupplement7S["GameNumber"]?></td>
				<td><?php print $_strSupplement7S["Odds"]?></td>
				<td><?php print $_strSupplement7S["WStake"]?></td>
			</tr>
			</table>
			</td>
		</tr>
		<tr>
			<td align="center"><input type="submit" class="submit" value="<?php print $_strSupplement7S["Send"];?>"></td>
		</tr>
		</table>
		</td>
	</tr>
	</table>
	</td>
</tr>
</table>
</form>
</div>
<!----------------------多號碼視窗----------------------------> 
<!----------------------下注明細圖層---------------------------->
<div id="wager_win" style="display: none;position:absolute">
<table width="120" border="0" cellspacing="1" cellpadding="2" bgcolor="00558E">
<tr><td bgcolor="#FFFFFF">
<table width="120" border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
<tr bgcolor="0163A2"> 
<td width="100" style="font-size:12px"><font color="#FFFFFF">&nbsp;<?php print $_strSupplement7S["WagerList"];?></td>
<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_WagerWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
</tr>
<tr bgcolor="#000000"><td colspan="2" height="1"></td></tr>
<tr bgcolor="#FFCC66"> 
<td colspan="2">
<div style="height:300px; overflow:auto; overflow-x:hidden;" id="WagerLayer">
<table id="WagerTable" class="MyTable" cellspacing="1" cellpadding="3" style="width: 483px;">
<tr align="center">
	<td width="60" class="MyTitleL"><?php print $_strSupplement7S["WGameTime"];?></td>
	<td width="80" class="MyTitleL"><?php print $_strSupplement7S["WAccount"];?></td>
	<td width="170" class="MyTitleL"><?php print $_strSupplement7S["WCont"];?></td>
	<td width="70" class="MyTitleL"><?php print $_strSupplement7S["WStake"];?></td>
	<td width="70" class="MyTitleL"><?php print $_strSupplement7S["WResult"];?></td>
</tr>
</table>
</div>
</td></tr></table>
</td></tr></table>
</div>
<!----------------------下注明細圖層----------------------------> 
<!----------------------連碼補貨圖層---------------------------->
<div id="supple_wager_win" style="display: none; position:absolute; top:175px;">
<table width="120" border="0" cellspacing="1" cellpadding="2" bgcolor="00558E">
<tr><td bgcolor="#FFFFFF">
<table width="120" border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
<tr bgcolor="0163A2"> 
<td width="100" style="font-size:12px"><font color="#FFFFFF">&nbsp;<?php print $_strSupplement7S["Supple"];?></td>
<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_SuppleWagerWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
</tr>
<tr bgcolor="#000000"><td colspan="2" height="1"></td></tr>
<tr bgcolor="#FFCC66"> 
<td colspan="2">
<div style="height:327px; overflow:auto; overflow-x:hidden;" id="SuppleWagerLayer">
<table id="SuppleWagerTable" class="MyTable" cellspacing="1" cellpadding="3" style="width: 500px;">
<tr align="center">
	<td width="40" class="MyTitleL">No</td>
	<td width="130" class="MyTitleL"><?php print $_strSupplement7S["GameNumber"];//號碼?></td>
	<td width="60" class="MyTitleL"><?php print $_strSupplement7S["WagerCount"];//累積筆數?></td>
	<td width="80" class="MyTitleL"><?php print $_strSupplement7S["SumPayOff"];//累積派彩?></td>
	<td width="80" class="MyTitleL"><?php print $_strSupplement7S["SumPayOff"];//累積派彩?>2</td>
	<td width="70" class="MyTitleL"><?php print $_strSupplement7S["SuppleSuggest"];//建議補貨?></td>
	<td width="40" class="MyTitleL"><?php print $_strSupplement7S["Supple"];//補貨?></td>
</tr>
</table>
</div>
</td></tr></table>
</td></tr></table>
</div>
<!----------------------外調結果圖層---------------------------->
<div id="supple_result_win" style="display: none;position:absolute; top: 200px; left=200px;width:190px;">
<table width="190" border="0" cellspacing="1" cellpadding="2" bgcolor="00558E">
<tr><td bgcolor="#FFFFFF">
<table width="190" border="0" cellspacing="0" cellpadding="0" class="m_tab_fix" >
<tr bgcolor="0163A2"> 
<td width="100" style="font-size:12px"><font color="#FFFFFF">&nbsp;<?php print $_strSupplement7S["SuppleResult"];?></td>
<td align="right" valign="top" ><a style="cursor:hand;" onClick="close_SuppleResultWin();"><img src="/images/k_admin/edit_dot.gif" width="16" height="14"></a></td>
</tr>
<tr bgcolor="#000000"><td colspan="2" height="1"></td></tr>
<tr bgcolor="#FFCC66"> 
<td colspan="2" id="SuppleResult"></td></tr></table>
</td></tr></table>
</div>
<!----------------------外調結果圖層----------------------------> 
<!----------------------連碼補貨圖層----------------------------> 
<iframe src="" width="110" height="110" name="getData"></iframe>
<form action="index.php" target="getData" name="getDataForm">
<input type="hidden" name="op" value="GetOdds">
<input type="hidden" name="LottoID" value="<?php print $intLottoID;?>">
<input type="hidden" name="GambleID" value="<?php print $intGID;?>">
<input type="hidden" name="Bet_Type" value="1,2,3,16">
<input type="hidden" name="isSpecial" value="1">
<input type="hidden" name="isStopBet" value="1">
<input type="hidden" name="isRealShow" value="1">
<input type="hidden" name="isGetSuppleOdds" value="<?php print $_data["isGetSuppleOdds"];?>">
<input type="hidden" name="strLottoNumber" value="<?php print $_strNumber;?>">
<input type="hidden" name="ChangeGameType" value="No">
<input type="hidden" name="GameType" value="<?php print $_data["GameType"];?>">
<input type="hidden" name="SpecialNumType" value="1">
<input type="hidden" name="OtherMsg" value="">
</form>
</body>
</html>